package com.example.ResumeWorkPlatform.service;

import java.util.Date;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.ResumeWorkPlatform.dao.BasicUserDao;
import com.example.ResumeWorkPlatform.dao.BasicUserEntity;
import com.example.ResumeWorkPlatform.dao.BoardDao;
import com.example.ResumeWorkPlatform.dao.WorkResumptioDao;


/**
 * @ClassName:BoardService
 * @Description: 看板Service层
 * @Copyright: smartlab411
 * @Author chengwenixng
 * @DateTime  2021-03-20 
 */
@Service
public class BoardService {
	private static final Logger log = LoggerFactory.getLogger( BoardService.class);
	
	@Autowired
	private BoardDao boardDao;
	@Autowired
	BasicUserDao basicUserDao;
	@Autowired
	private WorkResumptioDao workResumptioDao;
	
	/**
	 * 获取近七日扫码入园趋势
	 * @param long1 
	 * 
	 * @Title:  getBasicUserEntities
	 * @Description:
	 * @Author chengwenixng
	 * @DateTime  2021-03-20 
	 * @param account
	 * @throws MyException 
	 */
	public List<Object[]> getBoardEntities(Long id,Date startTime, Date endTime) {
		List<Object[]> boardEntities = boardDao.findBoardWeekIsWorks(id,startTime, endTime);	
		return boardEntities;
	}
	/**
	 * 获取近七日复工人员趋势
	 * @param long1 
	 * 
	 * @Title:  getBasicUserEntities
	 * @Description:
	 * @Author chengwenixng
	 * @DateTime 2021-04-7
	 * @param account
	 * @throws MyException 
	 */
	public List<Object[]> getWorkResumptions(Long id, Date startTime, Date endTime) {
		List<Object[]> workResumption =  workResumptioDao.findBoardWeekWorkResumptions(id,startTime, endTime);	
		return workResumption;
	}
	/**
	 * 
	 * @Title: getTodayWarning
	 * @Description: 获取今日入园人员信息
	 * @Authorchengwenixng
	 * @Date  2021-04-7
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<BasicUserEntity>  getTodayBasicUserLists(Long id) {
		List<BasicUserEntity>  getTodayBasicUserLists = basicUserDao.getTodayBasicUserLists(id);
		return getTodayBasicUserLists;
	}
}
